//
//  MineSettingViewController.swift
//  WalkerLove
//
//  Created by Boson on 2020/4/18.
//  Copyright © 2020 Carlson. All rights reserved.
//

import UIKit
import SnapKit
func ScreenHeight() -> CGFloat {
    return UIScreen.main.bounds.size.height
}

func ScreenWidth() -> CGFloat {
    return UIScreen.main.bounds.size.width
}
class MineSettingViewController: UIViewController,UITableViewDataSource,UITableViewDelegate{
    
    
    
    var mineSettingTV :UITableView!
    var mineSetArray = [["name":"赚钱攻略"],["name":"步数记录"],["name":"身体数据"],["name":"邀请好友"],["name":"在线客服"]]
    
    

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.red;
        
        self.navigationItem.title = "我的"
        
        
        
        
        
        
        mineSettingTV = UITableView(frame: CGRect(x: 0, y: 64, width: 375, height: 667), style: UITableView.Style.plain)
        mineSettingTV.delegate = self
        mineSettingTV.dataSource = self
        
        self.view.addSubview(mineSettingTV)
        
        
        var headerView = UIView(frame: CGRect(x: 0, y: 0, width: 375, height: 200))
        headerView.backgroundColor = UIColor.blue;
        
        mineSettingTV.tableHeaderView = headerView
        
        
        let currentGoldView = UIButton()
        let allGoldView = UIButton()

        
        currentGoldView.backgroundColor = UIColor.green
        
        headerView.addSubview(currentGoldView)
        
        allGoldView.backgroundColor = UIColor.purple
               
        headerView.addSubview(allGoldView)
        
        
        
        currentGoldView.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(15)
            make.top.equalToSuperview()
            make.bottom.equalToSuperview()
            make.size.width.equalTo(allGoldView)

        }
        
       
        
        allGoldView.snp.makeConstraints { (make) in
            make.left.equalTo(currentGoldView.snp.right).offset(15)
            make.top.equalToSuperview()
            make.bottom.equalToSuperview()
            make.right.equalToSuperview().offset(-15)

        }
        
        
        
        
        // Do any additional setup after loading the view.
    }
    
    
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        mineSetArray.count
    }
    
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 60.0
    }
    
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        
        let identifier = "MineSettingTableViewCell"
        
        let cell = MineSettingTableViewCell.init(style: UITableViewCell.CellStyle.default, reuseIdentifier: identifier)
        cell.titleLabel?.text = mineSetArray[indexPath.row]["name"]
        return cell
    }
    
    
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
